<template>
	<el-container style="height: 650px; border: 1px solid #eee">
	  <el-aside width="200px"  style="background-color: rgb(208, 208, 208)">
	    <el-menu  router> <!-- 别忘了标签里加上router -->  <!-- :default-openeds="['0']" 暂时不用-->
	      <el-submenu v-for="(item,index) in $router.options.routes" v-if="item.show" :key="index" :index="index+''">
	        <template slot="title"><i class="el-icon-message"></i>{{item.name}}</template>
	          <el-menu-item v-for="(item2,index2) in item.children" v-if="item2.show" :key="index2" :index="item2.path" :class="$route.path==item2.path?'is-active':''">{{item2.name}}</el-menu-item>
	      </el-submenu>
	    </el-menu>
	  </el-aside>
	  
	  <el-container>
	    <el-header style="text-align: right; font-size: 12px">
	      <el-dropdown>
	        <i class="el-icon-setting" style="margin-right: 15px"></i>
	        <el-dropdown-menu slot="dropdown">
	          <el-dropdown-item >个人中心</el-dropdown-item>
	          <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item> <!-- 此处点击事件click后要加上.native -->
	        </el-dropdown-menu>
	      </el-dropdown>
	      <span >{{msg}}</span>
	    </el-header>
	    
	    <el-main>
			<router-view/>
	    </el-main>
	  </el-container>  
	</el-container>
</template>
<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>

<script>
  export default {
    data() {
      const item = {
        date: '',
        name: '',
        address: ''
      };
      return {
		msg:'',
        tableData: Array(20).fill(item),
      }
    },
	methods: {
		logout(){
			this.$router.push('/Login')
		}
	},
	created() {
		// console.log(this.$route.query.wname)
			this.msg=this.$route.query.wname
	}
  };
</script>


